# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/topics/item-pipeline.html
from scrapy.contrib.pipeline.images import ImagesPipeline
from scrapy.exceptions import DropItem
from scrapy.http import Request
class ExtremefunnypicturesPipelines(ImagesPipeline):

    def get_media_requests(self, item, info):
		print "item[url]:" + item['url']
		yield Request(item['url'])

    def item_completed(self, results, item, info):
        paths = [x['path'] for ok, x in results if ok]
        if not paths:
            raise DropItem("Item contains no images")
        item['path'] = paths
        return item		
